<template>
	<view id="lin-family-lineage" class="digital-page">
		<view class="top-banner">
			<image src="../../static/Dp/Logo_487x93.png" mode="widthFix"></image>
		</view>
		<view class="banner">
			<view class="title-area">
				<div class="title-cn">林氏家系</div>
				<div class="title-en">Lin family lineage</div>
			</view>
		</view>
		<view class="main-content">
			<template v-for="(v, k) in data" :key="k" >
				<view class="block">
					<view class="header">
						{{ v.Topic }}
					</view>
					<rich-text :nodes="v.nodes" class="content"  @click="richTextClick(v.imgs)"></rich-text>
				</view>
			</template>
		</view>
	</view>
</template>

<script setup>
	//姚珅 @ 4月18日
	//姚珅 @ 5月2日 绑定
	// 姚珅 @ 5月20日 返回组件添加
	// 黄玺 @ 9月9日 重写逻辑
	import { onLoad } from '@dcloudio/uni-app'
	import backBtn from './back.vue'
	import { ref } from 'vue'
	import parseHtmlData from './parseHtmlData.js'
	import setShare from '../../share.js'
	setShare({
		title: '林氏家系 - 云上埔坪',
		path: "/pages/DigitalPlatform/LinFamilyLineage"
	});
	let uniqueCode = "3nGCmJKzeyq893Z3fTrorp";
	let data = ref([]);
	
	uni.post("/api/categorySource", {
		uniqueCode,
		hasContent: true,
		page: 1,
		pageSize: 10
	}).then(msg => {
		for (let d of msg.data) {
			let { nodes, imgs } = parseHtmlData(d.Content);
			d.nodes = nodes;
			d.imgs = imgs;
			data.value.push(d);
		}
	});
	
	function richTextClick (imgs) {
		if (imgs.length) {
			wx.previewImage({
				current: imgs[0], // 当前显示图片的http链接
				urls: imgs
			})
		}
	}
</script>

<style lang="less">
	@import url(shared.less);
	@title-cn-size: 52rpx;
	@title-en-size: 20rpx;
	@title-size: 25rpx;
	@name-cn-size: 20rpx;
	@name-en-size: 10rpx;

	#lin-family-lineage {
		.banner {
			.show-bg("https://www.lin-home.com/static/DigitalPlatform/03林氏家系/banner.jpg")
		}
		.title-area {
			width: calc(32rpx * 18);
		}

		.main-content {
			padding-bottom: 20rpx;
		}
	}
</style>
